home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / doom / deep865s.zip / SCRIPTS.DOC < prev    next >
Text File  |  1996-03-03  |  18KB  |  451 lines

  1.                      Understanding The HEXEN Script Code
  2.                      -----------------------------------
  3.                      And Making Action Scripts for HEXEN
  4.  
  5.                               By : Chris Becker
  6.  
  7.     --------
  8.     - NOTE -
  9.     --------
  10.  
  11.     This file is intended to be in the ZIP file that contains DeeP.
  12.     If you do not have DeeP or or use another editor, some of this 
  13.     information may not apply.
  14.  
  15.     If you do not have DeeP or use another editor, I greatly recommend 
  16.     that you use DeeP. It is probably the best DOOM_HERETIC_HEXEN editor 
  17.     there is. If you do have it and like it, please register!
  18.  
  19.  
  20.     ---------------------
  21.     - TABLE OF CONTENTS -
  22.     ---------------------
  23.  
  24.     I. Introduction
  25.       
  26.        1. What is an Action Script File?
  27.        2. What do I have to know?
  28.        3. What are the requirements?
  29.  
  30.     II. Understanding the Script Code and some commands
  31.  
  32.        4. The format of an Action Script file (an ACS file)
  33.        5. (void) and OPEN
  34.        6. LineSpecials
  35.        7. Constants
  36.        8. Printing Messages
  37.        9. DELAY
  38.       10. TAGWAIT
  39.       11. RANDOM
  40.       12. TERMINATE
  41.       13. The all-mighty Semi-Colon
  42.  
  43.     III. Conclusion
  44.  
  45.       14. A word to the Un-wise     
  46.       15. If you need help or want to learn more...      
  47.       16. Credits                  
  48.  
  49.  
  50.  
  51.                                  INTRODUCTION
  52.                                ________________
  53.  
  54.  
  55.      -------------------------------------
  56.      - 1. What is an Action Script File? -
  57.      -------------------------------------
  58.  
  59.     An Action Script File (ACS) is a set of actions for HEXEN to read. 
  60.     An ACS file isn't necessary for a HEXEN level. Scripts are used for
  61.     any kind of actions you want to happen that you can't do with 
  62.     just the standard LineDef specials. 
  63.     
  64.     For example, in a standard level, you would have a line that opens a 
  65.     door when you walk over it. This would not require a script, since you 
  66.     can do this with a standard LineDef type in the editor. But if you 
  67.     wanted the line to open a door, make an elevator go down, and have
  68.     the ceiling come down, this would require a script. One line
  69.     cannot do more than one different thing at a time.
  70.  
  71.  
  72.     ------------------------------
  73.     - 2. What do I have to know? -
  74.     ------------------------------
  75.  
  76.     Well you should know how to make a P-Wad fairly well and 
  77.     understand how that stuff works. If not, then I recommend that you     
  78.     take some time and learn the basics of level making. (Look in your     
  79.     DeeP text files for help on that.) If you know that stuff, this 
  80.     should be easy after you understand it. Other than that, that's all     
  81.     you should have to know.
  82.  
  83.     - NOTE - 
  84.     
  85.     I am also still learning this stuff and some of this stuff may not 
  86.     be totally the way a pro would do it. But the information in this 
  87.     document should be sufficient enough to start writing good scripts.
  88.  
  89.     (Note by SBS: And that's why we like it! The perspective of a beginner 
  90.     limits the discussion to essential elements.)
  91.  
  92.     -------------------
  93.     - 3. Requirements -
  94.     -------------------
  95.  
  96.     You should have DeeP (The DOOM_HERETIC_HEXEN editor) but if you 
  97.     don't you need some kind of utilities that will make the script and     
  98.     put the script into a wad file. And you need the EDIT program
  99.     usually found in your DOS directory. This is where you will be         
  100.     writing the scripts. You should also have HEXEN.
  101.  
  102.  
  103.  
  104.  
  105.  
  106.                    Understanding The HEXEN Script Code
  107.                  _______________________________________
  108.  
  109.                             And Some Commands
  110.  
  111.  
  112.      -------------------------------
  113.      - 4. The format of an ACS File-
  114.      -------------------------------
  115.  
  116.     The format of an ACS file is simple. This is one of the easiest 
  117.     parts of making ACS files. But these parts of an ACS are essential.
  118.     The file won't work if the format is not followed.
  119.  
  120.     Here is an example...
  121. _______________________________________________
  122.                                                |
  123. #include "common.acs"                          |
  124.                                                |
  125. Script 1 (void)                                |
  126. {                                              |
  127.     -YOUR COMMANDS HERE-                       |
  128. }                                              |
  129. _______________________________________________|
  130.  
  131.     The "#include "common.acs" line is needed to tell the script 
  132.     making program to include the file COMMON.ACS file. (The
  133.     COMMON.ACS file has a lot of information needed for items and
  134.     the different things you can do in HEXEN.)
  135.  
  136.     The "Script 1 (void)" line is self explanitory. This line tells
  137.     the script number your working on. The "(void)" part of this line
  138.     you will learn about later. If you're just starting, use this as a 
  139.     default.
  140.  
  141.     The "{" thing is used when you are ready to start putting commands     
  142.     in the script. The "}" thing means you are ready to stop puting        
  143.     in commands.    
  144.     
  145.     NOTE - If for any reason you need to use more than one of these, 
  146.     remember to align them on the same line (makes it easier to read)! 
  147.     Like this...
  148.  
  149. _______________________________________________
  150. {                                              |
  151.   {                                            |
  152.     -YOUR COMMANDS HERE-                       |
  153.   }                                            |
  154. }                                              |
  155. _______________________________________________|
  156.  
  157.     As you can see all "{" and "}" things are aligned on the same line. 
  158.     The "-YOUR COMMANDS HERE-" line tells where all your commands go.
  159.  
  160.  
  161.     ----------------------
  162.     - 5. (void) and OPEN -
  163.     ----------------------
  164.  
  165.     "(void)" and "OPEN" are simple. "(void)" means that there are no 
  166.     variables passed to the script. (You will learn about variables later
  167.     in this document.) For many scripts you use "(void)".
  168.  
  169.     You use "OPEN" when you want the script to run as soon as the  
  170.     game starts. Use this when you want to activate something in the 
  171.     beginning of the level. Examples are printing a message, playing
  172.     a sound track, lowering a floor, you know, all the fun stuff!
  173.  
  174.     -Look at the examples below...
  175.  
  176. ______________________________________________
  177.                                               |
  178. Script 1 (void)                               |  There are no Variables
  179. {                                             |  passed to this script.
  180.         -YOUR COMMANDS HERE-                  |  
  181. }                                             |  Use when starting out!   
  182. ______________________________________________|            
  183.  
  184.                        and
  185. ______________________________________________
  186.                                               |
  187. Script 1 OPEN                                 |  This script prints
  188. {                                             |      "Hi. I rule" 
  189.         print(s:"Hi. I rule");                |  when the game starts.  
  190. }                                             |
  191. ______________________________________________|
  192.  
  193.  
  194.     --------------------
  195.     - 6. Line Specials -
  196.     --------------------
  197.  
  198.     Line Specials are the meat of the script. These are the parts that
  199.     tell what's going to happen. Like let's say you wanted a floor to 
  200.     rise up after a line had been crossed. This is what it would 
  201.     look like...
  202.  
  203. ______________________________________________
  204. Script 1 (void)                               |
  205. {                                             |  This is telling HEXEN that
  206.         Floor_RaiseByValue(CONSTANTS);        |  you want a floor to rise
  207. }                                             |  by a certain value.
  208.                                               |  The (CONSTANTS) part is 
  209.                                               |  covered next.
  210. ____________________________________________